<?php echo $header; ?>

<div id="columnswrapper">
	<?php echo $column_left; ?>
	<div id="intro">
		<div class="inner">
			<h3><?php echo $intro;?></h3>
			<div id="introcontent">
				<div id="introimage">
				<img class="alignleft" alt="intro image" src="<?php echo $logo;?>" />
				</div><!-- end introimage -->
				<p><?php echo $welcome;?></p>
		
				<div class="clearleft"></div>
			</div><!-- end introcontent -->
			<?php if ($cats_info) {
				foreach ($cats_info as $cat_info){	
					$articles=$cat_info['articles'];    
		    		$cats=$cat_info['cats']; ?>
		    		<h3><?php echo $cat_info['heading_title'];?></h3>
		    		<?php		    		
					if ($cats) {?>
					<?php if(sizeof($cats)>1){?>
		    		<div class="tabs" id="<?php echo $cat_info['cat_id']?>">
		    			<?php for ($i = 0; $i < sizeof($cats); $i++) { ?>		  				      
		      			<a tab="<?php echo "#tab_".$cats[$i]['cat_id'];?>"><?php echo $cats[$i]['name'];?></a>
		     			<?php }?>
		     		</div>
		     		<?php }?>
    				<?php for ($i = 0; $i < sizeof($cats); $i++) { ?>
		  				<div id="<?php echo "tab_".$cats[$i]['cat_id'];?>" class="tab_page">
		  					<div class="news-category" style="width:560px;">     
		      				<div class="news-content" >
								<?php if(isset($articles[$cats[$i]['cat_id']])){?>
								<?php for ($j = 0; $j < sizeof($articles[$cats[$i]['cat_id']]); $j++) { ?>
								<?php if($j==0){ 
								if(sizeof($articles[$cats[$i]['cat_id']])>1){ ?> 
							    <div class="news-first" style="width:300px;margin-right:30px;">
							    <?php }else{?>
							    <div class="news-first" style="width:560px;">
							    <?php }?>
							        <ul >
							            <li style="background-image: none;"><a href="<?php echo $articles[$cats[$i]['cat_id']][$j]['href'];?>" class="first-tiltle first-right"><?php echo $articles[$cats[$i]['cat_id']][$j]['name'];?></a>
											<div style="clear:left;width:300px;"></div>
											<a href="<?php echo $articles[$cats[$i]['cat_id']][$j]['href'];?>" class="first-tiltle first-left">
											<img src="<?php echo $articles[$cats[$i]['cat_id']][$j]['thumb'];?>" alt="<?php echo $articles[$cats[$i]['cat_id']][$j]['name'];?>" class="first-img" />
											</a>
											<div class="date2"><?php echo $articles[$cats[$i]['cat_id']][$j]['date_available'];?></div>
							                <div style="font-size:13px;"><?php echo $articles[$cats[$i]['cat_id']][$j]['meta_description'];?></div>
							            </li>
							        </ul>
							    </div>
							    <div class="news-list">
							    <ul>
							    <?php }?>
							    
							    	<?php if($j!=0){?>
							            <li class="sub-list">
											<a href="<?php echo $articles[$cats[$i]['cat_id']][$j]['href'];?>">
												<?php echo $articles[$cats[$i]['cat_id']][$j]['name'];?>
											</a>
										</li>			            
							         <?php }?>
							        
							    
							    <?php }?>
							    	</ul>
							    </div>
							    <?php }else{?>
							    	<div style="font-size:15px;"><?php echo $text_error;?></div>
							    <?php }?>
							</div>
							</div>
		     			</div>
    				<?php }?>
    				<?php }else{ ?>
    					<div id="<?php echo "tab_".$cat_info['cat_id'];?>" class="tab_page">
		  					<div class="news-category" style="width:560px;">     
		      				<div class="news-content" >
								<?php if(isset($articles[$cat_info['cat_id']])){?>
								<?php for ($j = 0; $j < sizeof($articles[$cat_info['cat_id']]); $j++) { ?>
								
								<?php if($j==0){ 
								if(sizeof($articles[$cat_info['cat_id']])>1){ ?> 
							    <div class="news-first" style="width:300px;">
							    <?php }else{?>
							    <div class="news-first" style="width:560px;">
							    <?php }?>
							        <ul style="list-style:none!important;">
							            <li><a href="<?php echo $articles[$cat_info['cat_id']][$j]['href'];?>" class="first-tiltle first-right"><?php echo $articles[$cat_info['cat_id']][$j]['name'];?></a>
											<a href="<?php echo $articles[$cat_info['cat_id']][$j]['href'];?>" class="first-tiltle first-left">
											<img src="<?php echo $articles[$cat_info['cat_id']][$j]['thumb'];?>" alt="<?php echo $articles[$cat_info['cat_id']][$j]['name'];?>" class="first-img" />
											</a>
											<div class="date2"><?php echo $articles[$cat_info['cat_id']][$j]['date_available'];?></div>
							                <p><?php echo $articles[$cat_info['cat_id']][$j]['meta_description'];?></p>
							            </li>
							        </ul>
							    </div>
							    <div class="news-list">
							    <ul>
							    <?php }?>
							    
							    	<?php if($j!=0){?>
							            <li class="sub-list">
											<a href="<?php echo $articles[$cat_info['cat_id']][$j]['href'];?>">
												<?php echo $articles[$cat_info['cat_id']][$j]['name'];?>
											</a>
										</li>			            
							         <?php }?>
							        
							    
							    <?php }?>
							    	</ul>
							    </div>
							    <?php }else{?>
							    	<div style="font-size:15px;"><?php echo $text_error;?></div>
							    <?php }?>
							</div>
							</div>
		     			</div>
    				<?php }?>
    			<?php }?>
    		<?php }?>	
    		<script type="text/javascript"><!--
    		<?php if ($cats_info) {
				foreach ($cats_info as $cat_info){	?>
				$.tabs('#<?php echo $cat_info['cat_id']?> a'); 
				<?php }?>
			<?php }?>
			//--></script>
		</div><!-- end inner -->
		<?php foreach ($modules as $module) { ?>
		  <?php echo ${$module['code']}; ?>
		  <?php } ?>
	</div><!-- end intro -->	
	
<?php echo $column_right; ?>
	</div><!-- end columnswrapper -->
<?php echo $footer; ?> 